<?php
if(!defined('SABLOG_ROOT')) {
	exit('Access Denied');
}

if ($stats['tag_count']) {
	$pagenum = 100;
	if($page) {
		$start_limit = ($page - 1) * $pagenum;
	} else {
		$start_limit = 0;
		$page = 1;
	}

	$multipage = multi($stats['tag_count'], $pagenum, $page, $tagslist_url);
	$query = $DB->query("SELECT * FROM {$db_prefix}tags ORDER BY tagid DESC LIMIT $start_limit, ".$pagenum);

	$tagdb = array();
	while ($tag = $DB->fetch_array($query)) {
		$tag['fontsize'] = 12 + $tag['usenum'] / 2;
		$tag['url'] = gettaglink(urlencode($tag['tag']));
		$tag['usenum'] = intval($tag['usenum']);
		$tag['item'] = htmlspecialchars($tag['tag']);
		$tagdb[]=$tag;
	}
	unset($tag);
	$DB->free_result($query);
}
$options['title'] = settitle('tag');
$pagefile = 'tag';

?>